using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Bubble : MonoBehaviour
{
    public float speed = 5f; // Speed of the bubble
    public float destroyY = 10f; // Y-value at which the bubble will be destroyed

    void Update()
    {
        // Move the bubble upwards
        transform.Translate(Vector3.up * speed * Time.deltaTime);

        // Destroy the bubble if it goes above the destroyY value
        if (transform.position.y >= destroyY)
        {
            Destroy(gameObject);
        }
    }
}
